from pyJianYingDraft.metadata import VideoCharacterEffectType


# 遍历枚举类的key和value
for member in VideoCharacterEffectType:
    key = member.name
    value = member.value
    resource_id = value.resource_id
    name = value.name
    effect_id = value.effect_id
    md5 = value.md5
    params = value.params
    vip = "true" if value.is_vip else "false"
    if vip == "true" :
        continue
    print(f"        put(\"{name}\", new EffectMeta(\"{effect_id}\", \"{resource_id}\", \"{name}\", {vip}, \"{md5}\", Arrays.asList(")
    for i, param in enumerate(params):
        # 判断是否为最后一个元素
        if i == len(params) - 1:
            print(f"            new EffectParam(\"{param.name}\", {param.default_value}f, {param.min_value}f, {param.max_value}f)")
        else:
            print(f"            new EffectParam(\"{param.name}\", {param.default_value}f, {param.min_value}f, {param.max_value}f),")
    print(f"        )));")

print(f"\n\n\n\n\n\n下面的是vip材料\n\n\n\n\n\n")

# 遍历枚举类的key和value
for member in VideoCharacterEffectType:
    key = member.name
    value = member.value
    resource_id = value.resource_id
    name = value.name
    effect_id = value.effect_id
    md5 = value.md5
    params = value.params
    vip = "true" if value.is_vip else "false"
    if vip == "false" :
        continue
    print(f"        put(\"{name}\", new EffectMeta(\"{effect_id}\", \"{resource_id}\", \"{name}\", {vip}, \"{md5}\", Arrays.asList(")
    for i, param in enumerate(params):
        # 判断是否为最后一个元素
        if i == len(params) - 1:
            print(f"            new EffectParam(\"{param.name}\", {param.default_value}f, {param.min_value}f, {param.max_value}f)")
        else:
            print(f"            new EffectParam(\"{param.name}\", {param.default_value}f, {param.min_value}f, {param.max_value}f),")
    print(f"        )));")
